package top.lixunda.commerce.common.core.controller.wrapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * @author LiXunda
 * @version time:2019/10/15 14:19
 */
@SuppressWarnings({"unused", "WeakerAccess"})
public class BaseDataQuerySqlWrapper<T> extends BaseDataSqlWrapper<T> {

    public BaseDataQuerySqlWrapper() {
        super.isQuery(true);
    }

    public static <T> BaseDataQuerySqlWrapper<T> fromWrapper(IAbstractSqlWrapper<T> wrapper) {
        return (BaseDataQuerySqlWrapper<T>) fromWrapper(wrapper, new BaseDataQuerySqlWrapper<>());
    }

    @SuppressWarnings("unchecked")
    public QueryWrapper<T> toQueryWrapper() {
        return (QueryWrapper<T>) toMyBatisWrapper(this);
    }

    public static <T> BaseDataQuerySqlWrapper toDataQuerySqlWrapper(IAbstractSqlWrapper<T> wrapper) {
        return (BaseDataQuerySqlWrapper<T>) fromWrapper(wrapper, new BaseDataQuerySqlWrapper<>());
    }
}
